﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace WPFExcelReport
{

    public partial class TSZRULES
    {
        public TSZRULES()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            InitializeComponent();
         }
        public override void Reset()
        {
            base.Reset();
        }
        private void btnResetP_Click(object sender, RoutedEventArgs e)
        {
            Reset();
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            CHKFLOW(); 
        }
        public void CHKFLOW()
        {
            if (dwMaster == null)
                return;
            string ARTSTAGE = dwMaster["ARTSTAGE"].ToString();
            FLOW = dwMaster["UNDES"].ToString();
            switch (app.company)
            {
                case "YGR":

                    string GSFACH = dwMaster["P2"].ToString();
                    FLOW = "";
                    if (System.Convert.ToDouble(GSFACH) > 1)
                    {
                        FLOW = "XS000002";
                    }
                    else
                    {
                        FLOW = "XS000001";
                    } 
                    break;
                default:
                case "SXN":

                    break;
            }
        }
       
    }
}
